<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form-model layout="inline">
        <a-row :gutter="24">
          <a-col :md="5" :sm="8">
            <a-form-item label="设备类型">
              <a-select v-model="queryParam.equType" placeholder="请选择">
                <a-select-option value="">全部</a-select-option>
                <a-select-option v-for="(item, i) in equTypeList" :key="i" :value="item.value">{{
                  item.label
                }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="5" :sm="8">
            <a-form-item label="在线状态">
              <a-select v-model="queryParam.onlintStatus">
                <a-select-option value="">全部</a-select-option>
                <a-select-option :value="1"> 未激活 </a-select-option>
                <a-select-option :value="2"> 在线 </a-select-option>
                <a-select-option :value="3"> 离线 </a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="5" :sm="8">
            <a-form-item label="关联农污终端">
              <a-select
                v-model="queryParam.terminalId"
                show-search
                allowClear
                placeholder="请选择"
                :default-active-first-option="false"
                :show-arrow="false"
                :not-found-content="null"
                option-filter-prop="children"
              >
                <!-- 显示终端名称+编号 -->
                <a-select-option :value="undefined">请选择</a-select-option>
                <a-select-option v-for="item in terminalList" :key="item.value" :value="item.value">
                  {{ item.label }}
                </a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="5" :sm="8">
            <a-form-item label="设备名称">
              <a-input placeholder="请输入设备名称" v-model="equName" />
            </a-form-item>
          </a-col>
          <a-col :md="5" :sm="8">
            <a-form-item label="设备编号">
              <a-input placeholder="请输入设备编号" v-model="queryParam.equNo" />
            </a-form-item>
          </a-col>
          <a-col :md="5" :sm="8">
            <a-form-item label="安装位置">
              <j-dict-select-tag
                placeholder="请选择管点类型"
                v-model="queryParam.installPos"
                dictCode="ps_install_pos"
              />
            </a-form-item>
          </a-col>
          <!-- <a-col :md="5" :sm="8">
            <a-form-item label="区域">
              <j-select-depart placeholder="请选择区域" v-model="queryParam.pointArea" />
            </a-form-item>
          </a-col>
          <a-col :md="5" :sm="8">
            <a-form-item label="设备归属状态">
              <a-select v-model="queryParam.equBelong" placeholder="请选择">
                <a-select-option value="">全部</a-select-option>
                <a-select-option value="1"> 租赁 </a-select-option>
                <a-select-option value="2"> 售卖 </a-select-option>
                <a-select-option value="3"> 临时 </a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="5" :sm="8">
            <a-form-item label="设备编号">
              <a-input v-model="queryParam.equNo" allowClear placeholder="请输入"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="5" :sm="8">
            <a-form-item label="管点编号">
              <a-input v-model="pipPointNo" allowClear placeholder="请输入"></a-input>
            </a-form-item>
          </a-col> -->
          <a-col :md="4" :sm="8">
            <a-form-item :wrapper-col="{ span: 14, offset: 4 }">
              <a-button type="primary" @click="searchQuery"> 查询 </a-button>
              <a-button style="margin: 0 0 10px 8px" @click="customerSearchReset"> 重置 </a-button>
            </a-form-item>
          </a-col>
        </a-row>
      </a-form-model>
    </div>
    <!-- 查询区域-END -->

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAddEquip(true)" type="primary" icon="plus">有点安装</a-button>
      <a-button @click="handleAddEquip(false)" type="primary" icon="plus">无点安装</a-button>
      <a-upload
        name="file"
        :showUploadList="false"
        :multiple="false"
        :headers="tokenHeader"
        :action="importExcelUrl"
        @change="handleImportExcel"
      >
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload>
    </div>

    <!-- table区域-begin -->
    <div>
      <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
        <a style="font-weight: 600">{{ selectedRowKeys.length }}</a
        >项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div> -->

      <a-table
        ref="table"
        size="middle"
        :scroll="{ x: true }"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        @change="handleEquTableChange"
      >
        <!--  :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" -->
        <template slot="equType" slot-scope="equType">
          <span>{{ equType | filterEquType(equTypeList) }}</span>
        </template>
        <span slot="action" slot-scope="text, record">
          <a @click="handleEditEquip(record)" class="ant-btn-group">编辑</a>
          <a @click="machineEdit(record, 'machine')" class="ant-btn-group">移机</a>
          <a @click="machineEdit(record, 'change')" class="ant-btn-group">更换</a>
          <!-- <a-popconfirm title="确定注销吗?" @confirm="() => remove(record.id)">
            <a class="ant-btn-group">注销</a>
          </a-popconfirm> -->
          <a-popconfirm title="确定删除吗?" @confirm="() => handleCustomerDelete(record.id)">
            <a class="ant-btn-group">删除</a>
          </a-popconfirm>
          <a @click="commandShow(record, 1, 10)">详情</a>
        </span>
      </a-table>
    </div>

    <!--  设备数据  -->
    <a-modal :title="title" v-model="visible" width="800" @ok="controlShow" @cancel="controlShow">
      <a-table
        :columns="dataListColumns"
        :dataSource="dataEquDataRtd"
        :pagination="dataListIpagination"
        @change="handleTableChange"
      >
        <template slot="equType" slot-scope="equType">
          <span>{{ equType | filterEquType(equTypeList) }}</span>
        </template>
      </a-table>
    </a-modal>

    <!-- 注册设备组件  -->
    <equipment-modal ref="modalForm" :hasPointFlag="hasPointFlag" @ok="modalFormOk"></equipment-modal>
    <!--  移机  -->
    <a-modal title="移机" v-model="machine" @ok="handleMachine">
      <a-form-model :modal="machineData">
        <a-form-item label="点位编号">
          <a-input v-model="machineData.pointCode" :disabled="true"></a-input>
        </a-form-item>
        <a-form-item label="设备编号">
          <a-input v-model="machineData.equNo" :disabled="true"></a-input>
        </a-form-item>
        <a-form-item label="目标点位编号" class="ant-form-item-required">
          <!-- <a-input v-model="machineData.newPointCode"></a-input> -->
          <a-select
            show-search
            v-model="machineData.newPointCode"
            placeholder="请输入点位编号"
            :default-active-first-option="false"
            :show-arrow="false"
            :filter-option="false"
            :not-found-content="null"
            @search="handleSearchPipPoint"
            @change="handleSelectPipPoint"
          >
            <a-select-option :value="undefined">请选择</a-select-option>
            <a-select-option
              v-for="item in pipPointList"
              :key="item.associationPosPointNo"
              :value="item.associationPosPointNo"
            >
              {{ item.associationPosPointNo }}
            </a-select-option>
          </a-select>
        </a-form-item>
        <a-form-item label="管点编号">
          <a-input v-model="machineData.pipPointNo" :disabled="true"></a-input>
        </a-form-item>
      </a-form-model>
    </a-modal>
    <!--  更换  -->
    <a-modal title="更换" :visible="change" @ok="handleMachine" @cancel="changeShow">
      <a-form-model :modal="changeData" :label-col="labelCol" :wrapper-col="wrapperCol">
        <a-form-item label="点位编号">
          <a-input v-model="changeData.pointCode" :disabled="true"></a-input>
        </a-form-item>
        <a-form-item label="原设备编号">
          <a-input v-model="changeData.equNo" :disabled="true"></a-input>
        </a-form-item>
        <a-form-item label="设备类型">
          <!-- <a-select v-model="changeData.newEquType">
            <a-select-option :value="1"> 液位仪</a-select-option>
            <a-select-option :value="2"> 水质监测</a-select-option>
            <a-select-option :value="3"> 流量计</a-select-option>
          </a-select> -->
          <JDictSelectTag v-model="changeData.newEquType" dictCode="ps_equ_type" />
        </a-form-item>
        <a-form-item label="新设备编号" class="ant-form-item-required">
          <a-input v-model="changeData.newEquNo" />
        </a-form-item>
        <a-form-item label="新SIM卡号">
          <a-input v-model="changeData.newSim"></a-input>
        </a-form-item>
      </a-form-model>
    </a-modal>
  </a-card>
</template>

<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import EquipmentModal from './modules/EquipManage/EquipmentModal'

import { getAction, delAction, httpAction } from '@api/manage'

import { getAreaEquList } from '@/api/dataQuery.js'
import { getDictItemListByCode } from '@/api/system.js'
import { filterObj } from '@/utils/util'
import debounce from 'lodash/debounce'
import { filterDictTextByCache } from '@/components/dict/JDictSelectUtil'

export default {
  name: 'EquipManageList',
  mixins: [JeecgListMixin, mixinDevice],
  components: {
    EquipmentModal,
    // moverMachine
  },
  filters: {
    filterEquType(equType, equTypeList) {
      const typeItem = equTypeList.find((item) => item.value === '' + equType)
      if (typeItem) {
        return typeItem.label
      } else {
        return equType
      }
    },
  },
  data() {
    this.lastFetchId = 0
    this.fetchUser = debounce(this.fetchUser, 800)
    return {
      loading: false,
      hasPointFlag: true,
      equTypeList: [],
      queryParam: {
        equType: '',
        equBelong: '',
        onlintStatus: '',
        equNo: '',
      },
      dataSource: [],
      pipPointNo: undefined,
      /* 分页参数 */
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['5', '10', '20', '30'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' 共' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0,
      },
      // 表头
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: (t, r, index) => {
            const { pageSize, current } = this.ipagination
            return (current - 1) * pageSize + parseInt(index) + 1
          },
        },
        {
          title: '设备名称',
          align: 'center',
          dataIndex: 'equName',
        },
        {
          title: '设备编号',
          align: 'center',
          dataIndex: 'equNo',
        },
        // {
        //   title: 'SIM卡号',
        //   align: 'center',
        //   dataIndex: 'sim',
        // },
        {
          title: '设备类型',
          align: 'center',
          dataIndex: 'equType',
          scopedSlots: { customRender: 'equType' },
        },
        {
          title: '安装位置',
          align: 'center',
          dataIndex: 'installPos',
          customRender: (text, record, index) => {
            return filterDictTextByCache('ps_install_pos', text)
          },
        },
        {
          title: '点位编号',
          align: 'center',
          dataIndex: 'pointCode',
        },
        {
          title: '管点编号',
          align: 'center',
          dataIndex: 'pipPointNo',
        },
        // {
        //   title: '设备归属状态',
        //   align: 'center',
        //   dataIndex: 'equBelong',
        //   customRender: (text, record, index) => (text ? (text == 1 ? '租赁' : text == 2 ? '售卖' : '临时') : ''),
        // },
        {
          title: '补偿值',
          align: 'center',
          dataIndex: 'compensate',
        },
        {
          title: '在线状态',
          align: 'center',
          dataIndex: 'onlintStatus',
          customRender: (text, record, index) => {
            return filterDictTextByCache('ps_equ_status', text)
          },
        },
        {
          title: '注册时间',
          align: 'center',
          dataIndex: 'createTime',
        },
        {
          title: '最新上线时间',
          align: 'center',
          dataIndex: 'lastOnlineDate',
        },
        {
          title: '终端编号',
          align: 'center',
          dataIndex: 'terminalId',
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          fixed: 'right',
          width: 147,
          scopedSlots: { customRender: 'action' },
        },
      ],

      url: {
        list: '/paishui/equipment/list',
        delete2: '/paishui/equipment/del', // 逻辑删除
        delete: '/paishui/equipment/delete', // 物理删除
        deleteBatch: '/paishui/equipment/deleteBatch',
        exportXlsUrl: '/paishui/equipment/exportXls',
        importExcelUrl: 'paishui/equipment/importExcel',
        edit: '/paishui/equipment/edit',
        // 实时数据查询 list列表
        equDataRtdList: '/paishui/equDataRtd/list',
      },
      dictOptions: {},
      superFieldList: [],
      form: this.$form.createForm(this),
      labelCol: { span: 4 },
      wrapperCol: { span: 14 },
      // table数据源
      title: '设备数据列表',
      visible: false,
      //设备数据表头
      dataListColumns: [
        {
          title: '设备编号',
          align: 'center',
          dataIndex: 'equNo',
        },
        // 设备类型需要从首页面带过来
        {
          title: '设备类型',
          align: 'center',
          dataIndex: 'equType',
          scopedSlots: { customRender: 'equType' },
        },
        {
          title: '接收时间',
          align: 'center',
          dataIndex: 'reportTime',
        },
        {
          title: '液位高度',
          align: 'center',
          dataIndex: 'deviceData',
        },
        {
          title: '电池电量',
          align: 'center',
          dataIndex: 'battery',
        },
        {
          title: '信号强度',
          align: 'center',
          dataIndex: 'signalIntensity',
        },
      ],
      //设备数据list数据
      dataEquDataRtd: [],
      dataEquNo: '',
      dataInitializeIpagination: {
        pageIndex: 1,
        pageSize: 10,
        total: 0,
        showTotal: (total, range) => range[0] + '-' + range[1] + ' 共' + total + '条',
      },
      dataListIpagination: {
        pageIndex: 1,
        pageSize: 10,
        total: 0,
        showTotal: (total, range) => range[0] + '-' + range[1] + ' 共' + total + '条',
      },
      num: '',
      machine: false,
      machineData: {
        pointCode: '',
        equNo: '',
        id: '',
        newPointCode: '',
      },
      change: false,
      changeData: {
        id: '',
        pointCode: '',
        equNo: '',
        newEquType: '',
        newEquNo: '',
        newSim: '',
      },
      pipPointList: [], // 查询点位列表
      rules: {
        newEquNo: [{ required: true, message: '设备编号不能为空', trigger: 'blur' }],
      },
      temporaryType: '',
      //搜索框字段
      dataList: [],
      value: '',
      fetching: false,
      equName: '',
      terminalList: [], // 农污终端列表
    }
  },
  created() {
    this.getTerminalList()
    this.handleGetAreaEquList()
    this.handleGetDictItemList('ps_equ_type')
    this.handleSearchPipPoint = debounce(this.handleSearchPipPoint, 500)
  },
  computed: {
    importExcelUrl: function () {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    },
  },
  watch: {
    pipPointNo: function (pipPointNo) {
      if (pipPointNo) {
        this.queryParam.pipPointNo = `*${pipPointNo}*`
      } else {
        this.queryParam.pipPointNo = ''
      }
    },
    equName: function (equName) {
      if (equName) {
        this.queryParam.equName = `*${equName}*`
      } else {
        this.queryParam.equName = ''
      }
    },
  },
  methods: {
    async getTerminalList() {
      try {
        const res = await getAction(`/terminal/terminal/list`, { pageNo: 1, pageSize: 10000 })
        const terminalList = res.result.records || []
        this.terminalList = terminalList.map((terminal) => ({
          value: terminal.terminalId,
          label: `${terminal.terminalName}(${terminal.terminalId})`,
        }))
      } catch (error) {
        console.log(error)
      }
    },
    customerSearchReset() {
      this.pipPointNo = ''
      this.equName = ''
      this.searchReset()
    },
    handleAddEquip(hasPointFlag) {
      this.hasPointFlag = hasPointFlag
      this.handleAdd()
    },
    handleEditEquip(record) {
      this.hasPointFlag = !!record.pipPointNo
      this.handleEdit(record)
    },
    async handleCustomerDelete(id) {
      // 权限=>安装设备中的设备删除
      if (!this.url.delete) {
        this.$message.error('请设置url.delete属性!')
        return
      }
      var that = this
      httpAction(that.url.delete + '?id=' + id, { id: id }, 'post').then((res) => {
        if (res.success) {
          //重新计算分页问题
          that.reCalculatePage(1)
          that.$message.success(res.message)
          that.loadData()
        } else {
          that.$message.warning(res.message)
        }
      })
    },
    async handleSearchPipPoint(pointNo) {
      if (!pointNo) return
      const res = await getAction('/paishui/pipPoint/ori/list', {
        associationPosPointNo: `*${pointNo}*`,
        pageNo: 1,
        pageSize: 999,
      })
      console.log(res)
      if (res.success) {
        this.pipPointList = res.result.records || []
      }
    },
    handleSelectPipPoint(associationPosPointNo) {
      console.log('associationPosPointNo', associationPosPointNo)
      const pipPint = this.pipPointList.find((item) => associationPosPointNo === item.associationPosPointNo)
      if (pipPint) {
        this.machineData.pipPointNo = pipPint.pipNo
      } else {
        this.machineData.pipPointNo = ''
      }
    },
    async handleGetDictItemList(dictCode) {
      const res = await getDictItemListByCode({ dictCode })
      this.equTypeList = (res.result || []).map((x) => {
        return {
          name: x.itemText,
          label: x.itemText,
          value: x.itemValue,
        }
      })
    },
    async handleGetAreaEquList(page) {
      //加载数据 若传入参数1则加载第一页的内容
      if (page === 1) {
        this.ipagination.current = 1
      }
      const params = this.getQueryParams() //查询条件
      this.loading = true
      const res = await getAreaEquList(params)
      this.loading = false
      if (res.success) {
        this.dataSource = res.result.records || res.result
        if (res.result.total) {
          this.ipagination.total = res.result.total
        } else {
          this.ipagination.total = 0
        }
      } else {
        this.$message.warning(res.message)
      }
    },
    getQueryParams() {
      //获取查询条件
      let param = Object.assign(this.queryParam)
      param.pageNo = this.ipagination.current
      param.pageSize = this.ipagination.pageSize
      param.order = 'desc'
      param = filterObj(param)
      return param
    },
    searchQuery() {
      this.handleGetAreaEquList(1)
    },
    // 重置条件查询
    searchReset() {
      this.queryParam = {
        equType: '',
        equBelong: '',
        onlintStatus: '',
        equNo: '',
      }
      this.handleGetAreaEquList(1)
    },
    handleEquTableChange({ current, pageSize }) {
      this.ipagination.current = current
      this.ipagination.pageSize = pageSize
      this.handleGetAreaEquList()
    },
    //校验
    sads() {
      console.log(this.$refs)
      this.$refs.asd.validate((valid) => {
        console.log('handleMachine')
        if (valid) {
          let temporary = {
            id: this.changeData.id,
            equType: this.changeData.newEquType,
            equNo: this.changeData.newEquNo,
            sim: this.changeData.newSim,
          }
          httpAction(this.url.edit, temporary, 'post').then((res) => {
            console.log(res)
            this.handleGetAreaEquList(1)
            this.$message.success(res.message)
            this.change = !this.change
          })
        } else {
          return false
        }
      })
    },
    getSuperFieldList() {
      let fieldList = []
      fieldList.push({ type: 'string', value: 'equNo', text: '设备编号', dictCode: '' })
      fieldList.push({ type: 'string', value: 'sim', text: 'SIM卡号', dictCode: '' })
      fieldList.push({ type: 'int', value: 'equType', text: '设备类型', dictCode: '' })
      fieldList.push({ type: 'string', value: 'pointCode', text: '点位编号', dictCode: '' })
      fieldList.push({ type: 'int', value: 'compensate', text: '补偿值', dictCode: '' })
      fieldList.push({ type: 'int', value: 'equBelong', text: '设备归属状态', dictCode: '' })
      this.superFieldList = fieldList
    },
    remove(id) {
      delAction(this.url.delete, id).then((res) => {
        this.$message.success('删除成功!')
        this.handleGetAreaEquList(1)
      })
    },
    /*
     * 详情弹窗
     * */
    commandShow(record, pageNo, pageSize) {
      this.visible = true
      this.num = record.equNo
      getAction(
        `${this.url.equDataRtdList}?equNo=${record.equNo}&pageNo=${pageNo}&pageSize=${pageSize}&order=desc`
      ).then((res) => {
        console.log('res=====', res)
        this.dataEquDataRtd = res.result.records
        const pagination = { ...this.dataListIpagination }
        pagination.total = res.result.total || 0
        this.dataListIpagination = pagination
        this.temporaryType = record.equType
        for (let i = 0; i <= res.result.records.length; i++) {
          this.dataEquDataRtd[i].equType = record.equType
        }
      })
    },
    /*
     * 设备数据关闭
     * */
    controlShow(e) {
      console.log(e)
      this.dataEquDataRtd = []
    },
    //分页
    handleTableChange(pagination, filters, sorter) {
      //分页、排序、筛选变化时触发
      //TODO 筛选
      console.log('pagination=====', pagination)
      if (Object.keys(sorter).length > 0) {
        this.isorter.column = sorter.field
        this.isorter.order = 'ascend' == sorter.order ? 'asc' : 'desc'
      }
      this.ipagination = pagination
      if (this.visible == false) {
        this.dataListIpagination.current = 1
        this.loadData()
      } else {
        getAction(
          `${this.url.equDataRtdList}?equNo=${this.num}&pageNo=${pagination.current}&pageSize=${pagination.pageSize}&order=desc`
        ).then((res) => {
          this.dataEquDataRtd = res.result.records
          const paginationa = { ...pagination }
          paginationa.total = res.result.total || 0
          console.log('分页参数', paginationa)
          this.dataListIpagination = paginationa
          let temporary = this.temporaryType
          for (var i = 0; i <= res.result.records.length; i++) {
            this.dataEquDataRtd[i].equType = temporary
          }
        })
      }
    },
    machineEdit(record, type) {
      if (type == 'machine') {
        this.machine = !this.machine
        this.machineData = {
          pointCode: record.pointCode,
          equNo: record.equNo,
          id: record.id,
          newPointCode: '',
        }
      } else if (type == 'change') {
        this.change = true
        this.changeData = {
          id: record.id,
          pointCode: record.pointCode,
          equNo: record.equNo,
          newEquType: '',
          newEquNo: '',
          newSim: '',
        }
      }
    },
    submitForm() {},
    /*
     * 移机&更换事件
     * */
    handleMachine() {
      if (this.machine == true) {
        let temporary = {
          id: this.machineData.id,
          pointCode: this.machineData.newPointCode,
          pipPointNo: this.machineData.pipPointNo,
        }
        if (temporary.pointCode === '') {
          this.$message.error('目标点位编号不能为空')
        } else {
          httpAction(this.url.edit, temporary, 'post').then((res) => {
            console.log(res)
            this.handleGetAreaEquList(1)
            this.$message.success(res.message)
            this.machine = !this.machine
          })
        }
      } else if (this.change == true) {
        let temporary = {
          id: this.changeData.id,
          equType: this.changeData.newEquType,
          equNo: this.changeData.newEquNo,
          sim: this.changeData.newSim,
        }
        if (temporary.equNo === '') {
          this.$message.error('新设备编号不能为空')
        } else {
          httpAction(this.url.edit, temporary, 'post').then((res) => {
            console.log(res)
            this.handleGetAreaEquList(1)
            this.$message.success(res.message)
            this.change = !this.change
          })
        }
      }
    },
    changeShow() {
      this.change = !this.change
    },
    /*
     * 选中 option 变化时
     * */
    handleChange(value, option) {
      console.log('value value', value)
      console.log('option value', option)
      Object.assign(this, {
        value,
        dataList: [],
        fetching: false,
      })
    },
    /*
     * 文本框值变化时回调
     * */
    fetchUser(value) {
      this.lastFetchId += 1
      this.dataList = []
      this.fetching = true
      if (value == undefined) value = ''
      getAction(`/paishui/equipment/list?equNo=*${value}*`).then((res) => {
        this.dataList = res.result.records
        console.log('fetch User res', this.dataList)
      })
    },
  },
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';

.form-flex {
  display: flex;
}

.ant-btn-group {
  margin-right: 5px;
}

.ant-row-flex .ant-col-6 {
  width: 10%;
}

.ant-row .ant-col-4 {
  width: 36.666667%;
}

.ant-form-item-required label:before {
  display: inline-block;
  margin-right: 4px;
  color: #f5222d;
  font-size: 14px;
  font-family: SimSun, sans-serif;
  line-height: 1;
  content: '*';
}
</style>
